package com.gxa.mapper;

import com.gxa.pojo.Employee;
import com.gxa.pojo.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: tx
 * Date: 2020/11/02 17:38
 * Description:
 * Version: V1.0
 */
public interface EmployeeBaseMapper {

    /**
     * 添加
     * @param employee
     * @return
     */
    int addEmployeeBase(Employee employee);

    /**
     *删除
     * @param employeeId
     * @return
     */
    int delEmployeeBase(Integer employeeId);

    /**
     *更新
     * @param employee
     * @return
     */
    int updateEmployeeBase(Employee employee);

    /**
     *条件查询
     * @param employee
     * @return
     */
    Employee queryEmployeeBaseByEmployeeId(Employee employee);

    /**
     * 总查询
     * @param param1
     * @param param2
     * @return
     */
    List<Employee> queryEmployeeBase(int param1, int param2);

    /**
     * 总条数
     * @return
     */
    int getEmployeeSizeConis();


    /**
     * 查询员工在职状态
     * @param employeeId
     * @return
     */
    Employee queryEmpState(Integer employeeId);

    Integer selectEmployeeRoleIdByRoleName(@Param("role_name") String roleName);

    void addEmployeeRole(@Param("employee_id") Integer employeeId, @Param("role_id") Integer roleId);

    void updateEmployeeRole(@Param("employee_id") Integer employeeId, @Param("role_id") Integer roleId);

    List<Role> selectRole(@Param("employee_id") Integer employeeId);
}
